﻿function preSignature(url) {
	$.ajax({
		type: 'GET',
		url: 'http://120.221.153.170:8090/wechatflowfruit/commonCtl/getSignature?url=' + encodeURIComponent(url),
		dataType: 'json',
		async: false,
		success: function(data) {
			Signature =  JSON.parse(data.data);
			wx.config({
				debug: false,
				appId: "wx43a850f87498127d",
				timestamp: Signature.timeStamp,
				nonceStr: Signature.nonceStr,
				signature: Signature.jsSignature,
				jsApiList: [
					'onMenuShareTimeline',
					'onMenuShareAppMessage',
					'onMenuShareQQ',
					'onMenuShareQZone'
				]
			});
			wx.ready(function() {
				wx.onMenuShareTimeline({
					title: '流量福利不独享，码上有礼齐欢畅', // 分享标题
					link: url, // 分享链接
					imgUrl: 'http://wx.10086.cn/shandong/wx/otherSamllProject/newPoster/icon.png',
					success: function() {
						
					},
					cancel: function() {
						// 用户取消分享后执行的回调函数
					}
				});

				wx.onMenuShareAppMessage({
					title: '流量福利不独享，码上有礼齐欢畅', // 分享标题
					desc: '您的好友通过“中国移动10086”公众号成功兑换了300M，快来扫码参与吧~', // 分享描述
					link: url, 
					imgUrl: 'http://wx.10086.cn/shandong/wx/otherSamllProject/newPoster/icon.png',
					success: function() {
						
					},
					cancel: function() {
						// 用户取消分享后执行的回调函数
					}
				});

			});
		},
		error: function() {
			alert('信息读取失败提示!');
		}
	});
}
